schedule.Add( "ahrefNightModeOn", function() activateNight() end, nil, nil, 24, nil, nil, nil, nil )
schedule.Add( "ahrefNightModeOff", function() deactivateNight() end, nil, nil, 07, nil, nil, nil, nil )

function activateNight()
	game.ConsoleCommand("sbox_maxprops 60\n")
	game.ConsoleCommand("sbox_maxspawners 0\n")
	game.ConsoleCommand("sbox_maxwire_spawners 0\n")
	game.ConsoleCommand("ulx tooldeny ol_stacker\n")
	hook.Add( "PlayerLoadout", "ahrefNightAStrip", spawnCheck)
	return
end

function deactivateNight()
	game.ConsoleCommand( "sbox_maxprops 60 \n" )
	game.ConsoleCommand( "sbox_maxspawners 1\n" )
	game.ConsoleCommand( "sbox_maxwire_spawners 5 \n" )
	game.ConsoleCommand( "ulx toolallow ol_stacker \n" )
	hook.Remove( "PlayerSpawn",  "ahrefNightAStrip" )
	for k, v in pairs( player.GetAll() ) do
		if not v:HasWeapon( "weapon_physgun" ) then
			v:Give( "weapon_physgun" ); 
			v:Give( "gmod_tool" ); 
			v:Give( "gmod_camera" );
		end
		v:Give( "weapon_pistol" ); 
		v:Give( "weapon_357" );
		v:Give( "weapon_smg1" );
		v:Give( "weapon_ar2" );
		v:Give( "weapon_crossbow" );
		v:Give( "weapon_shotgun" );
		v:Give( "weapon_rpg" );
		v:Give( "weapon_frag" );
		v:Give( "weapon_physcannon" );
		v:Give( "weapon_crowbar" );
		v:SelectWeapon( "weapon_physcannon" )
	end 
	return
end

function spawnCheck(ply) //
	if ply:IsAdmin() or ply:IsSuperAdmin() then
		return
	else
		ply:Give( "weapon_physgun" ); 
		ply:Give( "gmod_tool" ); 
		ply:Give( "gmod_camera" );
		ply:SelectWeapon("weapon_physcannon")
		ULib.tsay( ply, "No weapons at night time", true )
		return true
	end
end

	